<%@ Import Namespace="System.Diagnostics" %>
<%@ Page Debug=true %>

<script runat=server>

Sub Page_Error(sender As Object, e As EventArgs)
  Response.Write("error!")
End Sub

Sub Button_Click(sender As Object, e As EventArgs)
  throw New Exception
End Sub

</script>

<form runat=server>
 <input type=text id=text1 runat=server>
 <input type=submit OnServerClick="Button_Click" runat=server/>
</form>